//
//  CTMediator+LoginActions.m
//  Component
//
//  Created by Andy_chen on 16/3/21.
//  Copyright © 2016年 Andycchen. All rights reserved.
//

#import "CTMediator+LoginActions.h"
NSString * const kCTMediatorTargetLogin = @"Login";

NSString * const kCTMediatorActionNativeFetchLoginViewController = @"nativeFetchLoginViewController";

@implementation CTMediator (LoginActions)

- (UIViewController *)CTMediator_viewControllerForLogin
{
    UIViewController *viewController = [self performTarget:kCTMediatorTargetLogin
                                                    action:kCTMediatorActionNativeFetchLoginViewController
                                                    params:@{@"key":@"value"}];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        // view controller 交付出去之后，可以由外界选择是push还是present
        return viewController;
    } else {
        // 这里处理异常场景，具体如何处理取决于产品
        return [[UIViewController alloc] init];
    }
}
@end
